<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>EasyQtSql: EasyQtSql::Util Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">EasyQtSql
   </div>
   <div id="projectbrief">Easy SQL data access helper for QtSql</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('class_easy_qt_sql_1_1_util.htm','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="class_easy_qt_sql_1_1_util-members.htm">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">EasyQtSql::Util Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Utility functions.  
 <a href="class_easy_qt_sql_1_1_util.htm#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_easy_qt_sql_8h_source.htm">EasyQtSql.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ade62df9ee2a3a40c94d7aad8b6cae23e"><td class="memTemplParams" colspan="2">template&lt;typename Func &gt; </td></tr>
<tr class="memitem:ade62df9ee2a3a40c94d7aad8b6cae23e"><td class="memTemplItemLeft" align="right" valign="top">static int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_easy_qt_sql_1_1_util.htm#ade62df9ee2a3a40c94d7aad8b6cae23e">each</a> (<a class="el" href="class_easy_qt_sql_1_1_query_result.htm">QueryResult</a> &amp;res, Func &amp;&amp;f)</td></tr>
<tr class="memdesc:ade62df9ee2a3a40c94d7aad8b6cae23e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Applies function (lambda) f to each row in res.  <a href="#ade62df9ee2a3a40c94d7aad8b6cae23e">More...</a><br /></td></tr>
<tr class="separator:ade62df9ee2a3a40c94d7aad8b6cae23e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a258b56d74e612aa2c40686accdf797d8"><td class="memTemplParams" colspan="2">template&lt;typename Func &gt; </td></tr>
<tr class="memitem:a258b56d74e612aa2c40686accdf797d8"><td class="memTemplItemLeft" align="right" valign="top">static int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_easy_qt_sql_1_1_util.htm#a258b56d74e612aa2c40686accdf797d8">range</a> (<a class="el" href="class_easy_qt_sql_1_1_query_result.htm">QueryResult</a> &amp;res, int start, int count, Func &amp;&amp;f)</td></tr>
<tr class="memdesc:a258b56d74e612aa2c40686accdf797d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Applies function (lambda) f to count rows starting from start index.  <a href="#a258b56d74e612aa2c40686accdf797d8">More...</a><br /></td></tr>
<tr class="separator:a258b56d74e612aa2c40686accdf797d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add143e9560791e7a0ffb52f4fae48eeb"><td class="memTemplParams" colspan="2">template&lt;typename Func &gt; </td></tr>
<tr class="memitem:add143e9560791e7a0ffb52f4fae48eeb"><td class="memTemplItemLeft" align="right" valign="top">static int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_easy_qt_sql_1_1_util.htm#add143e9560791e7a0ffb52f4fae48eeb">top</a> (<a class="el" href="class_easy_qt_sql_1_1_query_result.htm">QueryResult</a> &amp;res, int topCount, Func &amp;&amp;f)</td></tr>
<tr class="memdesc:add143e9560791e7a0ffb52f4fae48eeb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Applies function (lambda) f to topCount rows from res.  <a href="#add143e9560791e7a0ffb52f4fae48eeb">More...</a><br /></td></tr>
<tr class="separator:add143e9560791e7a0ffb52f4fae48eeb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a56dc7a2122381b76edac208e307f2eac"><td class="memTemplParams" colspan="2">template&lt;typename Func &gt; </td></tr>
<tr class="memitem:a56dc7a2122381b76edac208e307f2eac"><td class="memTemplItemLeft" align="right" valign="top">static int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_easy_qt_sql_1_1_util.htm#a56dc7a2122381b76edac208e307f2eac">first</a> (<a class="el" href="class_easy_qt_sql_1_1_query_result.htm">QueryResult</a> &amp;res, Func &amp;&amp;f)</td></tr>
<tr class="memdesc:a56dc7a2122381b76edac208e307f2eac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Applies function (lambda) f to first result row.  <a href="#a56dc7a2122381b76edac208e307f2eac">More...</a><br /></td></tr>
<tr class="separator:a56dc7a2122381b76edac208e307f2eac"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Utility functions. </p>
<div class="fragment"><div class="line">t.<a class="code" href="class_database.htm#ad2283c7025501aafc33530d19beb02b4">first</a>(<span class="stringliteral">&quot;SELECT 1&quot;</span>, [](<span class="keyword">const</span> <a class="code" href="class_query_result.htm">QueryResult</a> &amp;row){</div><div class="line">   qDebug() &lt;&lt; row.<a class="code" href="class_query_result.htm#a5e3b49cb821efecac406606d9e3adb13">scalar</a>&lt;<span class="keywordtype">bool</span>&gt;();</div><div class="line">});</div><div class="line"></div><div class="line">t.<a class="code" href="class_database.htm#a7a13f4fc603fb829f123894d9abd6ea7">each</a>(<span class="stringliteral">&quot;SELECT * FROM table1&quot;</span>, [](<span class="keyword">const</span> <a class="code" href="class_query_result.htm">QueryResult</a> &amp;row){</div><div class="line">   qDebug() &lt;&lt; row.<a class="code" href="class_query_result.htm#a023bd84f7010368d616d7dbb1b399a06">toMap</a>();</div><div class="line">});</div><div class="line"></div><div class="line"><a class="code" href="class_prepared_query.htm">PreparedQuery</a> query = t.<a class="code" href="class_database.htm#a03e2c9113452bb52bb7018ef2366bce1">prepare</a>(<span class="stringliteral">&quot;SELECT a, b, c, d FROM table1 WHERE a = ? AND b = ?&quot;</span>);</div><div class="line"></div><div class="line"><a class="code" href="class_easy_qt_sql_1_1_util.htm#ade62df9ee2a3a40c94d7aad8b6cae23e">Util::each</a>(query.<a class="code" href="class_prepared_query.htm#a1013aea1638d6d04868ce39130bc1b67">exec</a>(1, 2), [](<span class="keyword">const</span> <a class="code" href="class_query_result.htm">QueryResult</a> &amp;row){</div><div class="line">   qDebug() &lt;&lt; row.<a class="code" href="class_query_result.htm#a023bd84f7010368d616d7dbb1b399a06">toMap</a>();</div><div class="line">});</div></div><!-- fragment --> </div><h2 class="groupheader">Member Function Documentation</h2>
<a id="ade62df9ee2a3a40c94d7aad8b6cae23e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade62df9ee2a3a40c94d7aad8b6cae23e">&#9670;&nbsp;</a></span>each()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Func &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int EasyQtSql::Util::each </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_easy_qt_sql_1_1_query_result.htm">QueryResult</a> &amp;&#160;</td>
          <td class="paramname"><em>res</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Func &amp;&amp;&#160;</td>
          <td class="paramname"><em>f</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Applies function (lambda) f to each row in res. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">res</td><td><a class="el" href="class_easy_qt_sql_1_1_query_result.htm" title="QSqlQuery wrapper with handy data fetch methods. ">QueryResult</a> </td></tr>
    <tr><td class="paramname">f</td><td>Function </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a56dc7a2122381b76edac208e307f2eac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a56dc7a2122381b76edac208e307f2eac">&#9670;&nbsp;</a></span>first()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Func &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int EasyQtSql::Util::first </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_easy_qt_sql_1_1_query_result.htm">QueryResult</a> &amp;&#160;</td>
          <td class="paramname"><em>res</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Func &amp;&amp;&#160;</td>
          <td class="paramname"><em>f</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Applies function (lambda) f to first result row. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">res</td><td><a class="el" href="class_easy_qt_sql_1_1_query_result.htm" title="QSqlQuery wrapper with handy data fetch methods. ">QueryResult</a> <br />
</td></tr>
    <tr><td class="paramname">f</td><td>Function </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a258b56d74e612aa2c40686accdf797d8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a258b56d74e612aa2c40686accdf797d8">&#9670;&nbsp;</a></span>range()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Func &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int EasyQtSql::Util::range </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_easy_qt_sql_1_1_query_result.htm">QueryResult</a> &amp;&#160;</td>
          <td class="paramname"><em>res</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>start</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Func &amp;&amp;&#160;</td>
          <td class="paramname"><em>f</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Applies function (lambda) f to count rows starting from start index. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">res</td><td><a class="el" href="class_easy_qt_sql_1_1_query_result.htm" title="QSqlQuery wrapper with handy data fetch methods. ">QueryResult</a> </td></tr>
    <tr><td class="paramname">start</td><td>Index of start row </td></tr>
    <tr><td class="paramname">count</td><td>Rows count </td></tr>
    <tr><td class="paramname">f</td><td>Function </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="add143e9560791e7a0ffb52f4fae48eeb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#add143e9560791e7a0ffb52f4fae48eeb">&#9670;&nbsp;</a></span>top()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Func &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int EasyQtSql::Util::top </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_easy_qt_sql_1_1_query_result.htm">QueryResult</a> &amp;&#160;</td>
          <td class="paramname"><em>res</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>topCount</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Func &amp;&amp;&#160;</td>
          <td class="paramname"><em>f</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Applies function (lambda) f to topCount rows from res. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">res</td><td><a class="el" href="class_easy_qt_sql_1_1_query_result.htm" title="QSqlQuery wrapper with handy data fetch methods. ">QueryResult</a> </td></tr>
    <tr><td class="paramname">topCount</td><td>Count of rows </td></tr>
    <tr><td class="paramname">count</td><td>Rows count </td></tr>
    <tr><td class="paramname">f</td><td>Function </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>EasyQtSql/<a class="el" href="_easy_qt_sql_8h_source.htm">EasyQtSql.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespace_easy_qt_sql.htm">EasyQtSql</a></li><li class="navelem"><a class="el" href="class_easy_qt_sql_1_1_util.htm">Util</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>
